<?Php
	session_start();
	header("Cache-Control: no-store, no-cache, must-revalidate");
	if(session_is_registered('sesId')){
		require("templates/func_pagina.php");
		$fechaInicio=date("Y-m-d");
		$menu=Menu($tipousuario);
		$nombrelogin="";
		//echo $tipousuario."-".$_SESSION['cvesocio']."<br />";
		if ($tipousuario=='C' || $tipousuario=='F'){
			/*Se muestra la bienvenida del socio*/
			//echo "entro";
			if (trim($_SESSION['cvesocio'])>0){
				$nombrelogin=Obtener_Informacion_Socio($_SESSION['cvesocio']);	
			}else{
				$nombrelogin=Obtener_Nombre_Cliente($_SESSION['cvecliente']);	
			}
		}else{
			$nombrelogin=Obtener_Nombre_Agente($_SESSION['cveagente']);
		}
		
		echo "<html xmlns='http://www.w3.org/1999/xhtml'>\n";
		echo "<head>\n";
		echo "<title>GRUPO MORSA</title>\n";
		echo "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />\n";	
		echo "<link href='p7exp/p7exp.css' rel='stylesheet' type='text/css'> \n";

		echo "<script type='text/javascript' src='p7exp/p7exp.js'></script> \n";
		//echo "<!--[if lte IE 7]> \n";
		echo "<style> \n";
		echo " #menuwrapper, #p7menubar ul a {height: 30;} \n";
		echo " a:active {width: auto;} \n";
		echo "</style> \n";
	//	echo "<![endif]--> \n";

		echo "<LINK REL='stylesheet' TYPE='text/css' HREF='css/style.css'>\n";
		echo "<script src='./templates/morsa_principal.js?ms=".time()."'></script>\n";
		
		$javascript="<script language='Javascript'>\n";
		$javascript.=" function respuesta(opcion){\n";
		$javascript.="     var nvopcion='opcion".php."'; \n";				
		$javascript.="     document.getElementById('resultado').src=opcion; ";
		$javascript.="  }\n";
        $javascript.=" function Abrir_Ventana(url,ventana,props) {\n";
        $javascript.="		window.open(url,ventana,props);}\n";
        $javascript.="</script>\n";
		echo $javascript;

		echo "</head>\n";
		//echo "<body onload='$temporal'>\n";
                //echo "<body onload='displayMessage();'>\n"; //muestra mensaje
		echo "<body>\n";
		echo "<div id='content'>";
		echo "<table width='800' cellspacing='0' cellpadding='0'>";
		echo "<tr>";
			echo "<td>";
				echo "<img src='img/morsa.jpg' border='0' width='286' height='60'>";
			echo "</td>";
			
			echo "<td><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='240' height='55'>";
                        echo "<param name='movie' value='publicidad/b1.swf' />";
                        echo "<param name='quality' value='high' />";
                        echo "<embed src='publicidad/b1.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='240' height='55'></embed>";
                        echo "</object></td>";
			echo "<td><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='240' height='55'>";
                        echo "<param name='movie' value='publicidad/b2.swf' />";
                        echo "<param name='quality' value='high' />";
                        echo "<embed src='publicidad/b2.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='240' height='55'></embed>";
                        echo "</object></td>";
						
		echo "</tr>";
		echo "</table>";
		echo "<br />";
		//echo "<span id='retMenuTabs' name='retMenuTabs'>\n";

		echo $menu;
		echo "<br>\n";

		//echo "</span><br>\n";
		echo "</div>";
		echo "<div align='left'><table  width='800' cellspacing='0' cellpadding='0'><tr><td>";
			echo "Bienvenido: <strong>";
			echo $nombrelogin;
			echo "</strong></td><td> &nbsp;&nbsp;Soporte:&nbsp;<strong>01800 8307646</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
			echo " Fecha: <strong>".$fechaInicio." </strong></td></tr></table>";
		
		echo "</div>\n";
		
		echo "<iframe id='resultado' frameborder=0 scrolling=Yes width='100%' heIght='100%'></iframe>\n";
		
		echo "<script>\n";
		echo "  	function time(){\n";
		echo " 			setTimeout('check()', 100);\n";
		echo "		}\n";
		echo " 		function check(){\n";
  		echo "			if(document.self.closed){ \n";
  		echo "				alert('closed'); \n";
		echo "  		}\n";
		echo " 		}\n";
		echo "      P7_ExpMenu(); \n";
		echo "</script>\n";
                echo "<link rel='stylesheet' href='css/modal-message.css' type='text/css'>";
		echo "<script type='text/javascript' src='js/ajax.js'></script>";
		echo "<script type='text/javascript' src='js/modal-message.js'></script>";
		echo "<script type='text/javascript' src='js/ajax-dynamic-content.js'></script>";
		echo "<script type='text/javascript'>";
		echo "	messageObj = new DHTML_modalMessage(); ";
		echo "	messageObj.setShadowOffset(5);	";

		echo "	function displayMessage(){ ";
		echo "	messageObj.setSource('novedades.html'); ";
		echo "	messageObj.setCssClassMessageBox(false); ";
		echo "	messageObj.setSize(400,200); ";
		echo "	messageObj.setShadowDivVisible(true);	";
		echo "	messageObj.display(); ";
		echo "	} ";
		echo "	function closeMessage(){ ";
		echo "		messageObj.close();	 ";
		echo "	} ";
                echo "	</script>\n";
		echo "</body>\n";
		echo "</html>\n	";

	}
		else{
			//echo "problema registro sesion";
			header("LOCATION:index.php");
	}

?>


